import request from '@/utils/request'

export default {
    getList(query, size = 20, current = 1) {
        return request({
            url: `/article/label/search`,
            method: 'POST',
            data: {
                ...query,
                size, current
            }
        })
    },
    // 新增标签
    add(data) {
        return request({
            url: '/article/label',
            method: "post",
            data
        })
    },
    // 数据编辑根据id查询到数据传到子元素弹窗进行渲染
    getById(id) {
        return request({
            url: `/article/label/${id}`,
            method: 'get',
        })
    },
    // 弹窗编辑进行更新
    updata(data) {
        return request({
            url: `/article/label`,
            method: 'put',
            data
        })
    },
    // 通过id删除标签信息
    deleteByid(id){
        return request({
            url:`/article/label/${id}`,
            method:'delete',

        })
    }
}